package com.itsm.xkitsm.liferoot.ems;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.itsm.xkitsm.liferoot.R;

public class BaseAdapter_express extends BaseAdapter {
	private Context context;
	private String[] str_mes;

	public BaseAdapter_express(Context context) {
		super();
		this.context = context;
		str_mes = context.getResources().getStringArray(R.array.ems_company);
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return str_mes.length;
	}

	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return str_mes[arg0];
	}

	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	public View getView(int arg0, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		View view = LayoutInflater.from(context).inflate(
				R.layout.lv_expressitem, null);
		ImageView img_mes = (ImageView) view.findViewById(R.id.img_ems);
		TextView tv_mes = (TextView) view.findViewById(R.id.tv_ems);
		img_mes.setImageResource(ExpressSearchUI.int_arr[arg0]);
		tv_mes.setText(str_mes[arg0]);
		return view;
	}
}